<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/ckeditor/ckeditor.js"></script>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'article-form',
	'enableAjaxValidation'=>false,
	'htmlOptions'=>array('enctype' => 'multipart/form-data')
)); ?>
<script>
  $(document).ready(function(){
	  CKEDITOR.replace( 'Article[content]', {
	    //filebrowserImageUploadUrl : host + '/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
	    //filebrowserFlashUploadUrl : host + '/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
	  });
	});
</script>
<!--	<p class="note">Fields with <span class="required">*</span> are required.</p>-->
	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>73,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>55)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'content'); ?><br />
		<?php echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'content'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'category_id'); ?>
		<?php echo $form->dropDownList($model,'category_id', $categories, array('id'=>'category', 'prompt'=>'Chọn một chuyên mục', 'encode' => FALSE)); ?>
		<?php echo $form->error($model,'category_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'image'); ?>
		<?php echo $form->fileField($model,'image',array('size'=>61)); ?>
		<?php //echo $form->textField($model,'image',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'image'); ?>
		<?php if($model->image): ?>
      <?php echo CHtml::hiddenField('image', $model->image); ?>
      <div><?php echo CHtml::image(Params::getImageThumb130FromVcstorage($model->image), 'image', array('width' => '130')); ?></div>
    <?php endif; ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'tag'); ?>
		<?php echo $form->textField($model,'tag',array('size'=>73,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'tag'); ?>
	</div>
<!--

	<div class="row">
		<?php //echo $form->labelEx($model,'created_by'); ?>
		<?php //echo $form->textField($model,'created_by'); ?>
		<?php //echo $form->error($model,'created_by'); ?>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'created_at'); ?>
		<?php //echo $form->textField($model,'created_at'); ?>
		<?php //echo $form->error($model,'created_at'); ?>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'deleted_f'); ?>
		<?php //echo $form->textField($model,'deleted_f'); ?>
		<?php //echo $form->error($model,'deleted_f'); ?>
	</div>

-->
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->